import request from '@/utils/request'
/*
获取组织架构的数据 */
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

/*
1-删除组织架构的部门 */
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
/*
ps:
delete:删除业务
get:获取业务
post:新增或者增加业务
put：修改业务
 */

/*
2-新增部门 */
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

/*
3-获取部门详情 */
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

/*
4- 编辑部门 */
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
